<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        
    </style>
</head>
<body>
    
</body>
<script>
    
    var d1 = new Date("2008.8.8");
    var d2 = new Date();

    var t1 = Math.abs(d1 - d2);
    var t2 = Math.abs(d1.getTime() - d2.getTime());

    console.log( t1 );
    console.log( t2 );

    // 根据毫秒数，换算成：日，时，分，秒

</script>
</html>